<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title>react</title>
<script src="../../s/react/16.13.1/react.production.min.js"></script>
<script src="../../s/react/16.13.1/react-dom.production.min.js"></script>
<script src="../../s/babel/5.8.38/browser.min.js"></script>
</head>
<body>
	<div id="root"></div>
	<script type="text/babel">
		// 在 React 中，可以像基本的Javascript一样使用 for语句。
		function NumberList(props) {
			const numbers = props.numbers;
			let html = [];
			for(let i=0;i<numbers.length;i++){
            	html.push(<li>{numbers[i]}</li>)
        	}
			return (
				<ul>{html}</ul>
			);
		}
		const numbers = [1, 2, 3, 4, 5];
		ReactDOM.render(
			<NumberList numbers={numbers} />,
			document.getElementById('root')
		);
    </script>
</body>
</html>